home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!genesis.demon.co.uk
- From: Lawrence Kirby <fred@genesis.demon.co.uk>
- Newsgroups: comp.lang.c++,comp.lang.c
- Subject: Re: Hungarian notation
- Date: Sat, 20 Jan 96 01:34:49 GMT
- Organization: none
- Message-ID: <822101689snz@genesis.demon.co.uk>
- References: <4dhkae$an9@blackice.winternet.com> <821890870snz@genesis.demon.co.uk> <30fd5306.3171520@nntp.ix.netcom.com>
- Reply-To: fred@genesis.demon.co.uk
- X-NNTP-Posting-Host: genesis.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.27
- X-Mail2News-Path: genesis.demon.co.uk
-
- In article <30fd5306.3171520@nntp.ix.netcom.com>
- miker3@ix.netcom.com "Mike Rubenstein" writes:
-
- >I'm sure Lawrence is aware of this, but it's worth noting that while
- >casting to long double is almost certainly safe in that it will not
- >cause damage, it may not print out anything useful. It's possible
- >that time_t is an integral type that cannot be represented exactly as
- >a long double and the least significant bits, that are lost in the
- >conversion, may be significant.
-
- As Dan has pointed out long double is the only type you can use and be
- sure that it doesn't result in undefined behaviour. While loss of
- precision is possible the chances of this happening in practice are small.
- Of course you have to answer what the use is for printing out a time_t
- value. Most likely that is for debugging or it assumes a particular
- format. At any rate the result is inherently system specific.
-
- --
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-